package com.aspose.cells;

public class zcfw {
   private int q = 4096;
   public zcfp a = null;
   private int r;
   public boolean[] b = null;
   public zcfq c = new zcfk();
   public StringBuilder d = new StringBuilder(16);
   boolean e = false;
   boolean f = false;
   public boolean g;
   public char[] h;
   public int i = -1;
   public int j;
   public int k = 0;
   public zaop[] l;
   public zaop m;
   public int n = -1;
   public int o = 0;
   private com.aspose.cells.b.a.d.zn s;
   public boolean p;
   private static final com.aspose.cells.b.c.a.za t = new com.aspose.cells.b.c.a.za(new String[]{"&quot;", "&apos;", "&amp;", "&lt;", "&gt;", "&nbsp;", "&iexcl;", "&cent;", "&pound;", "&curren;", "&yen;", "&brvbar;", "&sect;", "&uml;", "&copy;", "&ordf;", "&laquo;", "&not;", "&shy;", "&reg;", "&macr;", "&deg;", "&plusmn;", "&sup2;", "&sup3;", "&acute;", "&micro;", "&para;", "&middot;", "&cedil;", "&sup1;", "&ordm;", "&raquo;", "&frac14;", "&frac12;", "&frac34;", "&iquest;", "&Agrave;", "&Aacute;", "&Acirc;", "&Atilde;", "&Auml;", "&Aring;", "&AElig;", "&Ccedil;", "&Egrave;", "&Eacute;", "&Ecirc;", "&Euml;", "&Igrave;", "&Iacute;", "&Icirc;", "&Iuml;", "&ETH;", "&Ntilde;", "&Ograve;", "&Oacute;", "&Ocirc;", "&Otilde;", "&Ouml;", "&times;", "&Oslash;", "&Ugrave;", "&Uacute;", "&Ucirc;", "&Uuml;", "&Yacute;", "&THORN;", "&szlig;", "&agrave;", "&aacute;", "&acirc;", "&atilde;", "&auml;", "&aring;", "&aelig;", "&ccedil;", "&egrave;", "&eacute;", "&ecirc;", "&euml;", "&igrave;", "&iacute;", "&icirc;", "&iuml;", "&eth;", "&ntilde;", "&ograve;", "&oacute;", "&ocirc;", "&otilde;", "&ouml;", "&divide;", "&oslash;", "&ugrave;", "&uacute;", "&ucirc;", "&uuml;", "&yacute;", "&thorn;", "&yuml;"});

   public static zcfw a(String var0, boolean var1) throws Exception {
      return new zcfw(var0, var1);
   }

   public zcfw(com.aspose.cells.b.a.d.zm var1) throws Exception {
      this.s = new com.aspose.cells.b.a.d.zn(var1, Encoding.getUTF8());
      this.z();
   }

   public zcfw(com.aspose.cells.b.a.d.zm var1, Encoding var2) throws Exception {
      this.s = new com.aspose.cells.b.a.d.zn(var1, var2 == null ? Encoding.getUTF8() : var2);
      this.z();
   }

   public zcfw(String var1, boolean var2) throws Exception {
      if (var2) {
         com.aspose.cells.b.a.d.ze var3 = com.aspose.cells.b.a.d.zd.b(var1);
         this.s = new com.aspose.cells.b.a.d.zn(var3, Encoding.getUTF8());
      } else {
         this.h = new char[var1.length() + 1];
         char[] var4 = var1.toCharArray();
         System.arraycopy(var4, 0, this.h, 0, var4.length);
         this.j = var1.length();
         this.i = -1;
      }

      this.z();
   }

   public void c() throws Exception {
      if (this.s != null) {
         this.s.a();
      }

   }

   public static int a(com.aspose.cells.b.a.d.zm var0) throws Exception {
      short var1 = 4096;
      if (var0.e()) {
         long var2 = var0.h() + 1L;
         if (var2 < (long)var1) {
            return (int)var2;
         }

         if (var2 > 65536L) {
            var1 = 8192;
         }
      }

      return var1;
   }

   private void z() throws Exception {
      this.l = new zaop[8];
      this.l[0] = new zaop();
      this.m = this.l[0];
      this.n = -1;
      this.o = 0;
      this.a = new zcfp();
      if (this.s != null) {
         this.q = a(this.s.b());
         this.h = new char[this.q];
         --this.q;
         this.j = this.s.a(this.h, 0, this.q);
         this.i = -1;
      }

   }

   public boolean d() throws Exception {
      if (this.g) {
         ++this.i;
         if (this.i >= this.j && !this.D()) {
            this.m = this.l[0];
            this.m.a = 0;
            --this.i;
            return false;
         }
      } else {
         boolean var1 = true;

         while(var1) {
            ++this.i;
            switch(this.h[this.i]) {
            case '\u0000':
               if (this.i >= this.j) {
                  if (!this.D()) {
                     this.m = this.l[0];
                     this.m.a = 0;
                     --this.i;
                     return false;
                  }

                  --this.i;
               }
            case '\t':
            case '\n':
            case '\r':
            case '\u0010':
            case '\u0013':
            case ' ':
               break;
            default:
               var1 = false;
            }
         }
      }

      if (this.h[this.i] == '<') {
         this.A();
      } else {
         this.k = this.i;
         String var2 = this.B();
         this.m = this.l[0];
         this.m.c = this.m.b = null;
         this.m.e = null;
         this.n = -1;
         this.o = 0;
         this.m.d = var2;
         this.m.a = 3;
         --this.i;
         ++this.r;
      }

      return true;
   }

   private void A() throws Exception {
      this.m = this.l[0];
      this.m.c = this.m.d = this.m.b = null;
      this.m.e = null;
      this.m.f = false;
      this.n = -1;
      this.o = 0;
      ++this.i;
      if (this.i >= this.j) {
         this.y();
      }

      boolean var1;
      switch(this.h[this.i]) {
      case '!':
         this.g();
         return;
      case '&':
         this.v();
         break;
      case '/':
         this.m.a = 4;
         if (this.p) {
            this.k = this.i + 1;
            var1 = true;

            while(var1) {
               ++this.i;
               switch(this.h[this.i]) {
               case '\u0000':
                  this.x();
                  --this.i;
                  break;
               case '&':
                  this.v();
                  break;
               case ':':
                  this.m.b = this.a.a(this.h, this.k, this.i - this.k);
                  this.k = this.i + 1;
                  break;
               case '>':
                  var1 = false;
               }
            }

            int var2 = this.i - 1;

            while(var2 >= this.k) {
               switch(this.h[var2]) {
               case '\t':
               case '\n':
               case '\r':
               case ' ':
                  --var2;
                  break;
               default:
                  this.m.c = this.a.a(this.h, this.k, var2 - this.k + 1);
                  return;
               }
            }
         } else {
            do {
               ++this.i;
               if (this.i >= this.j) {
                  this.y();
               }
            } while(this.h[this.i] != '>');
         }

         return;
      case '?':
         this.m.a = 6;
         this.e();
         return;
      case '_':
         this.C();
      }

      this.m.a = 1;
      var1 = true;
      boolean var7 = false;
      this.k = this.i;

      while(var1) {
         ++this.i;
         switch(this.h[this.i]) {
         case '\u0000':
            this.x();
            --this.i;
            break;
         case '\t':
         case '\n':
         case '\r':
         case ' ':
            var1 = false;
            break;
         case '&':
            this.v();
            break;
         case '/':
            var1 = false;
            var7 = true;
            this.m.f = true;
            break;
         case ':':
            this.m.b = this.a.a(this.h, this.k, this.i - this.k);
            this.k = this.i + 1;
            break;
         case '>':
            var1 = false;
            var7 = true;
            break;
         case '_':
            this.C();
         }
      }

      this.m.c = this.a.a(this.h, this.k, this.i - this.k);
      if (var7) {
         if (this.m.f) {
            ++this.i;
            if (this.i >= this.j) {
               this.y();
            }
         }

      } else {
         this.k = this.i + 1;
         var1 = true;
         zaop var3 = null;

         while(true) {
            while(var1) {
               ++this.i;
               zaop[] var4;
               switch(this.h[this.i]) {
               case '\u0000':
                  this.x();
                  --this.i;
                  break;
               case '\t':
               case '\n':
               case '\r':
               case ' ':
                  if (this.i == this.k) {
                     ++this.k;
                  }
                  break;
               case '&':
                  this.v();
                  break;
               case '/':
                  var1 = false;
                  this.m.f = true;
                  break;
               case ':':
                  ++this.o;
                  if (this.o >= this.l.length) {
                     var4 = new zaop[this.l.length << 1];
                     System.arraycopy(this.l, 0, var4, 0, this.l.length);
                     this.l = var4;
                  }

                  if (this.l[this.o] == null) {
                     var3 = new zaop();
                     var3.a = 2;
                     this.l[this.o] = var3;
                  } else {
                     var3 = this.l[this.o];
                     var3.e = null;
                     var3.d = null;
                  }

                  var3.b = this.a.a(this.h, this.k, this.i - this.k);
                  this.k = this.i + 1;
                  break;
               case '=':
                  if (var3 == null) {
                     ++this.o;
                     if (this.o + 1 > this.l.length) {
                        var4 = new zaop[this.l.length << 1];
                        System.arraycopy(this.l, 0, var4, 0, this.l.length);
                        this.l = var4;
                     }

                     if (this.l[this.o] == null) {
                        var3 = new zaop();
                        var3.a = 2;
                        this.l[this.o] = var3;
                     } else {
                        var3 = this.l[this.o];
                        var3.b = null;
                        var3.e = null;
                     }
                  }

                  boolean var8 = true;
                  int var5 = this.i - 1;

                  while(var5 >= this.k && var8) {
                     switch(this.h[var5]) {
                     default:
                        var3.c = this.a.a(this.h, this.k, var5 - this.k + 1);
                        var8 = false;
                     case '\t':
                     case '\n':
                     case '\r':
                     case ' ':
                        --var5;
                     }
                  }

                  var8 = true;
                  boolean var9 = true;

                  while(var8) {
                     ++this.i;
                     switch(this.h[this.i]) {
                     case '\u0000':
                        this.y();
                        --this.i;
                     case '\t':
                     case '\n':
                     case '\r':
                     case ' ':
                        break;
                     case '"':
                     case '\'':
                        var9 = false;
                        var8 = false;
                        this.k = this.i + 1;
                        break;
                     default:
                        var8 = false;
                        this.k = this.i;
                     }
                  }

                  char var6 = this.h[this.i];
                  var8 = true;

                  while(var8) {
                     ++this.i;
                     switch(this.h[this.i]) {
                     case '\u0000':
                        this.x();
                        --this.i;
                        break;
                     case '\t':
                     case '\n':
                     case '\r':
                     case ' ':
                        if (var9) {
                           var8 = false;
                        }
                        break;
                     case '"':
                     case '\'':
                        if (var6 == this.h[this.i] && !var9) {
                           var8 = false;
                        }
                        break;
                     case '&':
                        this.v();
                        break;
                     case '/':
                        if (var9) {
                           var8 = false;
                           var1 = false;
                           this.m.f = true;
                        }
                        break;
                     case '>':
                        if (var9) {
                           var8 = false;
                           var1 = false;
                        }
                        break;
                     case '_':
                        if (this.f) {
                           this.C();
                        }
                     }
                  }

                  var3.d = new String(this.h, this.k, this.i - this.k);
                  this.k = this.i + 1;
                  var3 = null;
                  break;
               case '>':
                  var1 = false;
               }
            }

            if (this.m.f) {
               ++this.i;
               if (this.i >= this.j) {
                  this.y();
               }
            }

            return;
         }
      }
   }

   public void e() throws Exception {
      while(true) {
         ++this.i;
         if (this.i >= this.j) {
            this.y();
         }

         if (this.h[this.i] == '?') {
            ++this.i;
            if (this.i >= this.j) {
               this.y();
            }

            if (this.h[this.i] == '>') {
               return;
            }
         }
      }
   }

   public int f() throws Exception {
      boolean var1 = true;
      ++this.i;
      if (this.i >= this.j) {
         this.y();
      }

      boolean var2;
      int var3;
      byte var5;
      switch(this.h[this.i]) {
      case '-':
         var2 = true;
         var5 = 7;
         ++this.i;
         if (this.i >= this.j) {
            this.y();
         }

         if (this.h[this.i] != '-') {
            throw new zcfn("Invalid xml comment");
         } else {
            while(true) {
               do {
                  if (!var2) {
                     return var5;
                  }

                  ++this.i;
                  if (this.i >= this.j) {
                     this.y();
                  }
               } while(this.h[this.i] != '-');

               var3 = 0;

               do {
                  ++var3;
                  ++this.i;
                  if (this.i >= this.j) {
                     this.y();
                  }
               } while(this.h[this.i] == '-');

               if (var3 >= 2) {
                  var2 = this.h[this.i] != '>';
               }
            }
         }
      case '[':
         var5 = 3;
         var2 = true;

         while(true) {
            do {
               if (!var2) {
                  return var5;
               }

               ++this.i;
               if (this.i >= this.j) {
                  this.y();
               }
            } while(this.h[this.i] != ']');

            var3 = 0;

            do {
               ++var3;
               ++this.i;
               if (this.i >= this.j) {
                  this.y();
               }
            } while(this.h[this.i] == ']');

            if (var3 >= 2) {
               var2 = this.h[this.i] != '>';
            }
         }
      default:
         var5 = 5;
         var2 = true;

         while(true) {
            label113:
            while(var2) {
               ++this.i;
               switch(this.h[this.i]) {
               case '\u0000':
                  this.y();
                  --this.i;
                  break;
               case '"':
               case '\'':
                  char var7 = this.h[this.i];

                  while(true) {
                     ++this.i;
                     if (this.i >= this.j) {
                        this.y();
                     }

                     if (this.h[this.i] == var7) {
                        continue label113;
                     }
                  }
               case '>':
                  var2 = false;
                  break;
               case '[':
                  boolean var6 = true;

                  while(true) {
                     label128:
                     while(true) {
                        if (!var6) {
                           continue label113;
                        }

                        ++this.i;
                        switch(this.h[this.i]) {
                        case '\u0000':
                           this.y();
                           --this.i;
                           break;
                        case '"':
                        case '\'':
                           char var4 = this.h[this.i];

                           while(true) {
                              ++this.i;
                              if (this.i >= this.j) {
                                 this.y();
                              }

                              if (this.h[this.i] == var4) {
                                 continue label128;
                              }
                           }
                        case '<':
                           ++this.i;
                           if (this.i >= this.j) {
                              this.y();
                           }

                           switch(this.h[this.i]) {
                           case '!':
                              this.f();
                              continue;
                           case '?':
                              this.e();
                           default:
                              continue;
                           }
                        case ']':
                           ++this.i;
                           if (this.i >= this.j) {
                              this.y();
                           }

                           if (this.h[this.i] != '>') {
                              throw new zcfn("missing \">\" of DTD in");
                           }

                           var6 = false;
                        }
                     }
                  }
               }
            }

            return var5;
         }
      }
   }

   public void g() throws Exception {
      ++this.i;
      if (this.i >= this.j) {
         this.y();
      }

      boolean var4;
      switch(this.h[this.i]) {
      case '-':
         this.m.a = 7;
         var4 = true;
         ++this.i;
         if (this.i >= this.j) {
            this.y();
         }

         if (this.h[this.i] != '-') {
            throw new zcfn("Invalid xml comment");
         }

         while(true) {
            do {
               if (!var4) {
                  return;
               }

               ++this.i;
               if (this.i >= this.j) {
                  this.y();
               }
            } while(this.h[this.i] != '-');

            int var2 = 0;

            do {
               ++var2;
               ++this.i;
               if (this.i >= this.j) {
                  this.y();
               }
            } while(this.h[this.i] == '-');

            if (var2 >= 2) {
               var4 = this.h[this.i] != '>';
            }
         }
      case '[':
         this.m.a = 3;

         do {
            ++this.i;
            if (this.i >= this.j) {
               this.y();
            }
         } while(this.h[this.i] != '[');

         this.k = this.i + 1;

         int var1;
         do {
            do {
               do {
                  ++this.i;
                  if (this.i >= this.j) {
                     this.w();
                  }
               } while(this.h[this.i] != ']');

               var1 = 0;

               do {
                  ++var1;
                  ++this.i;
                  if (this.i >= this.j) {
                     this.w();
                  }
               } while(this.h[this.i] == ']');
            } while(var1 < 2);
         } while(this.h[this.i] != '>');

         if (this.d.length() != 0) {
            this.d.append(this.h, this.k, this.i - this.k);
            this.m.d = this.d.substring(0, this.d.length() - 2);
            this.d.delete(0, 0 + this.d.length());
         } else {
            this.m.d = new String(this.h, this.k, this.i - this.k - 2);
         }
         break;
      default:
         this.m.a = 5;
         var4 = true;

         while(true) {
            label140:
            while(var4) {
               ++this.i;
               switch(this.h[this.i]) {
               case '\u0000':
                  this.y();
                  --this.i;
                  break;
               case '"':
               case '\'':
                  char var6 = this.h[this.i];

                  while(true) {
                     ++this.i;
                     if (this.i >= this.j) {
                        this.y();
                     }

                     if (this.h[this.i] == var6) {
                        continue label140;
                     }
                  }
               case '>':
                  var4 = false;
                  break;
               case '[':
                  boolean var5 = true;

                  while(true) {
                     label155:
                     while(true) {
                        if (!var5) {
                           continue label140;
                        }

                        ++this.i;
                        switch(this.h[this.i]) {
                        case '\u0000':
                           this.y();
                           --this.i;
                           break;
                        case '"':
                        case '\'':
                           char var3 = this.h[this.i];

                           while(true) {
                              ++this.i;
                              if (this.i >= this.j) {
                                 this.y();
                              }

                              if (this.h[this.i] == var3) {
                                 continue label155;
                              }
                           }
                        case '<':
                           ++this.i;
                           if (this.i >= this.j) {
                              this.y();
                           }

                           switch(this.h[this.i]) {
                           case '!':
                              this.f();
                              continue;
                           case '?':
                              this.e();
                           default:
                              continue;
                           }
                        case ']':
                           ++this.i;
                           if (this.i >= this.j) {
                              this.y();
                           }

                           if (this.h[this.i] != '>') {
                              throw new zcfn("missing \">\" of DTD in");
                           }

                           var5 = false;
                        }
                     }
                  }
               }
            }

            return;
         }
      }

   }

   public void a() throws Exception {
      if (this.l[0].a == 1 && !this.l[0].f) {
         int var1 = 1;

         label75:
         while(true) {
            while(true) {
               label46:
               while(true) {
                  if (var1 <= 0) {
                     break label75;
                  }

                  ++this.i;
                  switch(this.h[this.i]) {
                  case '\u0000':
                     this.y();
                     --this.i;
                     break;
                  case '<':
                     ++this.i;
                     if (this.i >= this.j) {
                        this.y();
                     }

                     boolean var2;
                     switch(this.h[this.i]) {
                     case '!':
                        this.f();
                        continue;
                     case '/':
                        --var1;

                        while(true) {
                           ++this.i;
                           if (this.i >= this.j) {
                              this.y();
                           }

                           if (this.h[this.i] == '>') {
                              continue label46;
                           }
                        }
                     case '?':
                        this.e();
                        continue;
                     default:
                        ++var1;
                        var2 = true;
                     }

                     while(true) {
                        label69:
                        while(true) {
                           if (!var2) {
                              continue label46;
                           }

                           ++this.i;
                           switch(this.h[this.i]) {
                           case '\u0000':
                              this.y();
                              --this.i;
                              break;
                           case '"':
                           case '\'':
                              char var3 = this.h[this.i];

                              while(true) {
                                 ++this.i;
                                 if (this.i >= this.j) {
                                    this.y();
                                 }

                                 if (this.h[this.i] == var3) {
                                    continue label69;
                                 }
                              }
                           case '/':
                              --var1;
                              break;
                           case '>':
                              var2 = false;
                           }
                        }
                     }
                  }
               }
            }
         }
      }

      this.d();
   }

   public void h() throws Exception {
      this.d();
   }

   private String B() throws Exception {
      while(true) {
         switch(this.h[this.i]) {
         case '\u0000':
            this.w();
            --this.i;
            break;
         case '\t':
         case '\n':
         case '\r':
         case ' ':
            if (!this.g && this.i == this.k && this.d.length() == 0) {
               ++this.k;
            }
            break;
         case '&':
            this.v();
            break;
         case '<':
            if (this.d.length() != 0) {
               this.d.append(this.h, this.k, this.i - this.k);
               String var1 = com.aspose.cells.b.a.zr.a(this.d);
               this.d.delete(0, 0 + this.d.length());
               return var1;
            }

            return new String(this.h, this.k, this.i - this.k);
         case '_':
            if (this.e) {
               this.C();
            }
         }

         ++this.i;
      }
   }

   public String a(boolean var1) throws Exception {
      this.c(var1);
      String var3 = this.i();
      this.c(var1);
      return var3;
   }

   public String i() throws Exception {
      if (this.l[0].f) {
         this.d();
         return "";
      } else {
         this.k = this.i + 1;
         String var1 = this.B();
         this.A();

         for(; this.m.a != 4; this.d()) {
            switch(this.m.a) {
            case 1:
               throw new zcfn("ReadElementString only could be called when the content is simple or empty.");
            case 3:
               var1 = var1 + this.m.d;
               break;
            case 8:
               var1 = var1 + this.m.d;
            }
         }

         this.d();
         return var1;
      }
   }

   public int j() throws Exception {
      boolean var1 = true;

      while(var1) {
         switch(this.l[0].a) {
         case 0:
         case 5:
         case 6:
         case 7:
            if (!this.d()) {
               return this.l[0].a;
            }
            break;
         case 1:
         case 2:
         case 3:
         case 4:
         default:
            var1 = false;
         }
      }

      return this.l[0].a;
   }

   public boolean k() {
      this.n = -1;
      this.m = this.l[0];
      return true;
   }

   public boolean l() {
      ++this.n;
      if (this.n < this.o) {
         this.m = this.l[this.n + 1];
         return true;
      } else {
         return false;
      }
   }

   public boolean m() {
      return this.o > 0;
   }

   public boolean n() {
      return this.l[0].f;
   }

   public String a(String var1, String var2) {
      var1 = this.a.a(var1);

      for(int var3 = 1; var3 <= this.o; ++var3) {
         if (com.aspose.cells.a.c.zx.b(this.l[var3].c, var1)) {
            return this.l[var3].d;
         }
      }

      return null;
   }

   public String a(String var1) {
      int var2 = var1.indexOf(58);
      if (var2 != -1) {
         var1 = this.a.a(var1.toCharArray(), var2 + 1, var1.length() - var2 - 1);
      } else {
         var1 = this.a.a(var1);
      }

      for(int var3 = 1; var3 <= this.o; ++var3) {
         if (com.aspose.cells.a.c.zx.b(this.l[var3].c, var1)) {
            return this.l[var3].d;
         }
      }

      return null;
   }

   public String o() {
      return this.m.a();
   }

   public String p() {
      return this.m.c;
   }

   public String q() {
      return this.m.b;
   }

   public int r() {
      return this.m.a;
   }

   public String s() {
      return this.m.d;
   }

   public int t() {
      return 0;
   }

   public String u() throws Exception {
      StringBuilder var1 = new StringBuilder();
      zcfx var2 = new zcfx(var1);
      var2.c(this.l[0].b, this.l[0].c, (String)null);
      if (this.o > 0) {
         for(int var3 = 1; var3 <= this.o; ++var3) {
            var2.a(this.l[var3].b, this.l[var3].c, (String)null, this.l[var3].d);
         }
      }

      String var4 = this.b();
      var2.d(var4);
      var2.b();
      return com.aspose.cells.b.a.zr.a(var1);
   }

   public String b() throws Exception {
      switch(this.m.a) {
      case 3:
      case 4:
      case 5:
      case 6:
      case 7:
      case 8:
         this.d();
         return "";
      default:
         if (this.l[0].f) {
            this.d();
            return "";
         } else {
            this.m = this.l[0];
            this.m.a = 4;
            this.k = this.i + 1;
            int var1 = 1;
            String var2 = null;

            while(true) {
               while(true) {
                  label73:
                  while(var1 > 0) {
                     ++this.i;
                     switch(this.h[this.i]) {
                     case '\u0000':
                        this.w();
                        --this.i;
                        break;
                     case '<':
                        ++this.i;
                        if (this.i >= this.j) {
                           this.w();
                        }

                        boolean var3;
                        switch(this.h[this.i]) {
                        case '!':
                           if (this.i == 0) {
                              this.d.delete(this.d.length() - 1, this.d.length() - 1 + 1);
                           } else {
                              this.d.append(this.h, this.k, this.i - this.k - 1);
                           }

                           this.f();
                           this.k = this.i + 1;
                           continue;
                        case '/':
                           --var1;
                           if (var1 == 0) {
                              if (this.i == 0) {
                                 if (this.d.length() != 0) {
                                    var2 = this.d.substring(0, this.d.length() - 1);
                                    this.d.delete(0, 0 + this.d.length());
                                 }
                              } else if (this.d.length() != 0) {
                                 this.d.append(this.h, this.k, this.i - this.k - 1);
                                 var2 = com.aspose.cells.b.a.zr.a(this.d);
                                 this.d.delete(0, 0 + this.d.length());
                              } else {
                                 var2 = new String(this.h, this.k, this.i - this.k - 1);
                              }
                           }

                           while(true) {
                              ++this.i;
                              if (this.i >= this.j) {
                                 if (var2 != null) {
                                    this.y();
                                 } else {
                                    this.w();
                                 }
                              }

                              if (this.h[this.i] == '>') {
                                 continue label73;
                              }
                           }
                        case '?':
                           if (this.i == 0) {
                              this.d.delete(this.d.length() - 1, this.d.length() - 1 + 1);
                           } else {
                              this.d.append(this.h, this.k, this.i - this.k - 1);
                           }

                           this.e();
                           this.k = this.i + 1;
                           continue;
                        default:
                           ++var1;
                           var3 = true;
                        }

                        while(true) {
                           label96:
                           while(true) {
                              if (!var3) {
                                 continue label73;
                              }

                              ++this.i;
                              switch(this.h[this.i]) {
                              case '\u0000':
                                 this.w();
                                 --this.i;
                                 break;
                              case '"':
                              case '\'':
                                 char var4 = this.h[this.i];

                                 while(true) {
                                    ++this.i;
                                    if (this.i >= this.j) {
                                       this.w();
                                    }

                                    if (this.h[this.i] == var4) {
                                       continue label96;
                                    }
                                 }
                              case '/':
                                 --var1;
                                 break;
                              case '>':
                                 var3 = false;
                              }
                           }
                        }
                     }
                  }

                  this.d();
                  return var2;
               }
            }
         }
      }
   }

   public zcfq a(zcft var1, boolean var2) throws Exception {
      if (this.b == null) {
         this.b = new boolean[256];
      }

      this.j();
      this.c.c = this.c.d = null;
      boolean var3 = this.g;
      int var4 = 0;
      Object var5 = this.c;

      do {
         zcfq var7;
         switch(this.m.a) {
         case 0:
         case 2:
         case 5:
         case 6:
         case 7:
         case 8:
         default:
            break;
         case 1:
            zcfl var9 = new zcfl((zcfq)var5);
            var9.a(this.l[0]);
            if (this.o > 0) {
               var9.a = new zcfh(var9, this.o);

               for(int var10 = 1; var10 <= this.o; ++var10) {
                  zcfg var8 = new zcfg(var9);
                  var8.a((zaop)this.l[var10]);
                  var9.a.a(var8);
               }
            }

            if (((zcfq)var5).d != null) {
               var7 = ((zcfq)var5).d.c;
               var9.c = var7;
               ((zcfq)var5).d.c = var9;
               ((zcfq)var5).d = var9;
            } else {
               var9.c = var9;
               ((zcfq)var5).d = var9;
            }

            if (!this.n()) {
               var5 = var9;
               if (var1 != null) {
                  zcfu var11 = var1.a(var9);
                  this.g = var11.a;
                  this.b[var4++] = this.g;
               } else {
                  this.b[var4++] = this.g;
               }
            }
            break;
         case 3:
            zcfv var6 = new zcfv((zcfq)var5);
            var6.h = this.l[0].d;
            if (((zcfq)var5).d != null) {
               var7 = ((zcfq)var5).d.c;
               var6.c = var7;
               ((zcfq)var5).d.c = var6;
               ((zcfq)var5).d = var6;
            } else {
               var6.c = var6;
               ((zcfq)var5).d = var6;
            }
            break;
         case 4:
            var5 = ((zcfq)var5).b;
            --var4;
            this.g = this.b[var4];
         }
      } while(var4 != 0 && this.d());

      this.g = var3;
      this.d();
      return var2 ? this.c : this.c.d;
   }

   private void C() throws Exception {
      if (this.i + 7 >= this.j) {
         this.b(7);
      }

      if (this.i + 7 < this.j) {
         int var1 = -1;
         int var2 = this.i;
         if (this.h[var2 + 1] == 'x' && this.h[var2 + 6] == '_') {
            var1 = 0;

            for(int var3 = 2; var3 < 6; ++var3) {
               int var4 = zcfi.b(this.h[var2 + var3]);
               if (var4 < 0) {
                  return;
               }

               var1 = (var1 << 4) + var4;
            }
         }

         if (var1 != -1) {
            byte var5 = 6;
            this.i += var5;
            this.h[this.i] = (char)var1;
            if (var2 - this.k < this.j - this.i) {
               System.arraycopy(this.h, this.k, this.h, this.k + var5, var2 - this.k);
               this.k += var5;
            } else {
               System.arraycopy(this.h, this.i, this.h, var2, this.j - this.i + 1);
               this.j -= var5;
               this.i = var2;
               this.h[this.j] = 0;
            }
         }

      }
   }

   public void v() throws Exception {
      if (this.i + 8 > this.j) {
         this.b(8);
      }

      int var1 = this.i;
      int var2 = 1;

      while(var2 < 8) {
         ++this.i;
         switch(this.h[this.i]) {
         case '/':
         case '<':
         case '>':
            --this.i;
            return;
         case ';':
            ++var2;
            int var3 = 0;
            if (var2 == 2) {
               return;
            }

            if (this.h[1 + var1] == '#') {
               int var4;
               if ((this.h[2 + var1] | 32) == 120) {
                  for(var4 = 3; var4 < var2 - 1; ++var4) {
                     int var5 = zcfi.b(this.h[var4 + var1]);
                     if (var5 < 0) {
                        return;
                     }

                     var3 = (var3 << 4) + var5;
                  }
               } else {
                  for(var4 = 2; var4 < var2 - 1; ++var4) {
                     if (!Character.isDigit(this.h[var4 + var1])) {
                        return;
                     }

                     var3 = var3 * 10 + this.h[var4 + var1] - 48;
                  }
               }
            } else {
               String var6 = new String(this.h, var1, var2);
               switch(t.a(var6)) {
               case 0:
                  var3 = 34;
                  break;
               case 1:
                  var3 = 39;
                  break;
               case 2:
                  var3 = 38;
                  break;
               case 3:
                  var3 = 60;
                  break;
               case 4:
                  var3 = 62;
                  break;
               case 5:
                  var3 = 32;
                  break;
               case 6:
                  var3 = 161;
                  break;
               case 7:
                  var3 = 162;
                  break;
               case 8:
                  var3 = 163;
                  break;
               case 9:
                  var3 = 164;
                  break;
               case 10:
                  var3 = 165;
                  break;
               case 11:
                  var3 = 166;
                  break;
               case 12:
                  var3 = 167;
                  break;
               case 13:
                  var3 = 168;
                  break;
               case 14:
                  var3 = 169;
                  break;
               case 15:
                  var3 = 170;
                  break;
               case 16:
                  var3 = 171;
                  break;
               case 17:
                  var3 = 172;
                  break;
               case 18:
                  var3 = 173;
                  break;
               case 19:
                  var3 = 174;
                  break;
               case 20:
                  var3 = 175;
                  break;
               case 21:
                  var3 = 176;
                  break;
               case 22:
                  var3 = 177;
                  break;
               case 23:
                  var3 = 178;
                  break;
               case 24:
                  var3 = 179;
                  break;
               case 25:
                  var3 = 180;
                  break;
               case 26:
                  var3 = 181;
                  break;
               case 27:
                  var3 = 182;
                  break;
               case 28:
                  var3 = 183;
                  break;
               case 29:
                  var3 = 184;
                  break;
               case 30:
                  var3 = 185;
                  break;
               case 31:
                  var3 = 186;
                  break;
               case 32:
                  var3 = 187;
                  break;
               case 33:
                  var3 = 188;
                  break;
               case 34:
                  var3 = 189;
                  break;
               case 35:
                  var3 = 190;
                  break;
               case 36:
                  var3 = 191;
                  break;
               case 37:
                  var3 = 192;
                  break;
               case 38:
                  var3 = 193;
                  break;
               case 39:
                  var3 = 194;
                  break;
               case 40:
                  var3 = 195;
                  break;
               case 41:
                  var3 = 196;
                  break;
               case 42:
                  var3 = 197;
                  break;
               case 43:
                  var3 = 198;
                  break;
               case 44:
                  var3 = 199;
                  break;
               case 45:
                  var3 = 200;
                  break;
               case 46:
                  var3 = 201;
                  break;
               case 47:
                  var3 = 202;
                  break;
               case 48:
                  var3 = 203;
                  break;
               case 49:
                  var3 = 204;
                  break;
               case 50:
                  var3 = 205;
                  break;
               case 51:
                  var3 = 206;
                  break;
               case 52:
                  var3 = 207;
                  break;
               case 53:
                  var3 = 208;
                  break;
               case 54:
                  var3 = 209;
                  break;
               case 55:
                  var3 = 210;
                  break;
               case 56:
                  var3 = 211;
                  break;
               case 57:
                  var3 = 212;
                  break;
               case 58:
                  var3 = 213;
                  break;
               case 59:
                  var3 = 214;
                  break;
               case 60:
                  var3 = 215;
                  break;
               case 61:
                  var3 = 216;
                  break;
               case 62:
                  var3 = 217;
                  break;
               case 63:
                  var3 = 218;
                  break;
               case 64:
                  var3 = 219;
                  break;
               case 65:
                  var3 = 220;
                  break;
               case 66:
                  var3 = 221;
                  break;
               case 67:
                  var3 = 222;
                  break;
               case 68:
                  var3 = 223;
                  break;
               case 69:
                  var3 = 224;
                  break;
               case 70:
                  var3 = 225;
                  break;
               case 71:
                  var3 = 226;
                  break;
               case 72:
                  var3 = 227;
                  break;
               case 73:
                  var3 = 228;
                  break;
               case 74:
                  var3 = 229;
                  break;
               case 75:
                  var3 = 230;
                  break;
               case 76:
                  var3 = 231;
                  break;
               case 77:
                  var3 = 232;
                  break;
               case 78:
                  var3 = 233;
                  break;
               case 79:
                  var3 = 234;
                  break;
               case 80:
                  var3 = 235;
                  break;
               case 81:
                  var3 = 236;
                  break;
               case 82:
                  var3 = 237;
                  break;
               case 83:
                  var3 = 238;
                  break;
               case 84:
                  var3 = 239;
                  break;
               case 85:
                  var3 = 240;
                  break;
               case 86:
                  var3 = 241;
                  break;
               case 87:
                  var3 = 242;
                  break;
               case 88:
                  var3 = 243;
                  break;
               case 89:
                  var3 = 244;
                  break;
               case 90:
                  var3 = 245;
                  break;
               case 91:
                  var3 = 246;
                  break;
               case 92:
                  var3 = 247;
                  break;
               case 93:
                  var3 = 248;
                  break;
               case 94:
                  var3 = 249;
                  break;
               case 95:
                  var3 = 250;
                  break;
               case 96:
                  var3 = 251;
                  break;
               case 97:
                  var3 = 252;
                  break;
               case 98:
                  var3 = 253;
                  break;
               case 99:
                  var3 = 254;
                  break;
               case 100:
                  var3 = 255;
                  break;
               default:
                  var3 = -1;
               }
            }

            if (var3 != -1) {
               this.h[this.i] = (char)var3;
               --var2;
               if (var1 - this.k < this.j - this.i) {
                  System.arraycopy(this.h, this.k, this.h, this.k + var2, var1 - this.k);
                  this.k += var2;
               } else {
                  System.arraycopy(this.h, this.i, this.h, var1, this.j - this.i + 1);
                  this.j -= var2;
                  this.i = var1;
                  this.h[this.j] = 0;
               }
            }

            return;
         default:
            ++var2;
         }
      }

   }

   public void b(boolean var1) {
      this.e = this.f = var1;
   }

   public void a(int var1) {
      this.g = var1 != 0;
   }

   public void c(boolean var1) {
      this.g = var1;
   }

   public void w() throws Exception {
      if (this.s == null) {
         throw new zcfn("Unexcepted eof.");
      } else {
         this.d.append(this.h, this.k, this.i - this.k);
         this.i = 0;
         this.k = 0;
         this.j = this.s.a(this.h, 0, this.q);
         if (this.j <= 0) {
            throw new zcfn("Unexcepted eof.");
         } else {
            if (this.j < this.q) {
               this.h[this.j] = 0;
            }

         }
      }
   }

   public void x() throws Exception {
      if (this.s == null) {
         throw new zcfn("Unexcepted eof.");
      } else if (this.k >= this.j) {
         this.j = this.s.a(this.h, 0, this.q);
         if (this.j <= 0) {
            throw new zcfn("Unexcepted eof.");
         } else {
            this.i = 0;
            this.k = 0;
            this.h[this.j] = 0;
         }
      } else {
         int var2;
         if (this.k != 0) {
            int var3 = this.j - this.k;
            System.arraycopy(this.h, this.k, this.h, 0, var3);
            var2 = this.s.a(this.h, var3, this.q - var3);
            if (var2 <= 0) {
               throw new zcfn("Unexcepted eof.");
            } else {
               this.j = var3 + var2;
               this.i -= this.k;
               this.k = 0;
               this.h[this.j] = 0;
            }
         } else {
            this.q <<= 1;
            char[] var1 = new char[this.q + 1];
            System.arraycopy(this.h, 0, var1, 0, this.i);
            this.h = var1;
            var2 = this.s.a(this.h, this.i, this.q - this.i);
            if (var2 <= 0) {
               throw new zcfn("Unexcepted eof.");
            } else {
               this.j = this.i + var2;
               this.h[this.j] = 0;
            }
         }
      }
   }

   public void b(int var1) throws Exception {
      if (this.s != null) {
         if (this.k >= this.j) {
            this.j = this.s.a(this.h, 0, this.q);
            if (this.j > 0) {
               this.i = 0;
               this.k = 0;
               this.h[this.j] = 0;
            }
         } else {
            int var2 = this.q - this.j;
            int var3;
            if (var2 < var1 && this.k != 0) {
               var3 = this.j - this.k;
               System.arraycopy(this.h, this.k, this.h, 0, var3);
               this.i -= this.k;
               this.k = 0;
               this.j = var3;
               this.h[this.j] = 0;
            }

            if (this.q - this.j < var1) {
               this.q <<= 1;
               char[] var4 = new char[this.q + 1];
               System.arraycopy(this.h, 0, var4, 0, this.j);
               this.h = var4;
            }

            var3 = this.s.a(this.h, this.j, this.q - this.j);
            if (var3 <= 0) {
               var3 = 0;
            }

            this.j += var3;
            this.h[this.j] = 0;
         }
      }
   }

   public void y() throws Exception {
      if (this.s == null) {
         throw new zcfn("Unexcepted eof.");
      } else {
         this.j = this.s.a(this.h, 0, this.q);
         if (this.j <= 0) {
            throw new zcfn("Unexcepted eof.");
         } else {
            this.i = 0;
            if (this.j < this.q) {
               this.h[this.j] = 0;
            }

         }
      }
   }

   private boolean D() throws Exception {
      if (this.s == null) {
         return false;
      } else {
         this.j = this.s.a(this.h, 0, this.q);
         if (this.j <= 0) {
            return false;
         } else {
            this.i = 0;
            if (this.j < this.q) {
               this.h[this.j] = 0;
            }

            return true;
         }
      }
   }
}
